{% extends "base.html" %}

{% block title %}Create locomotive{% endblock %}

{% block header %}
<h1>{% if object %}Modify locomotive{% else %}Create locomotive{% endif %}</h1>
{% endblock %}

{% block current_path %}
    <p>Locomotives ({% if object %}modify{% else %}create{% endif %})</p>
{% endblock %}

{% block content %}

<form action="" method="post">
    <p>
        <label for="id_model">Model:</label>
        {{ form.model }}
        {% if form.model.errors %}
            <span class="error">
                {{form.model.errors|join:", "}}
            </span>
        {% endif %}
    </p>
    
    <p>
        <label for="id_loc_number">Number:</label> 
        {{ form.loc_number }}
        {% if form.loc_number.errors %}
            <span class="error">
                {{form.loc_number.errors|join:", "}}
            </span>
        {% endif %}
    </p>
    
    <p>
        <label for="id_section_count">Sections:</label> 
        {{ form.section_count }}
        {% if form.section_count.errors %}
            <span class="error">
                {{form.section_count.errors|join:", "}}
            </span>
        {% endif %}
    </p>
    
    <p>
        <label for="id_customer">Customer:</label> 
        {{ form.customer }}
        {% if form.customer.errors %}
            <span class="error">
                {{form.customer.errors|join:", "}}
            </span>
        {% endif %}
    </p>
    
    <p>
        <input type="submit" value="{% if object %}Save{% else %}Create{% endif %}">
    </p>
</form>

{% endblock %}

